<%
// 首页图片 13
var topPics = temp.rollPicture(1);

// 最新动态
var newArticles = temp.articlePageTop(1, 10, session.site.siteId);

// 新闻 2
var news = temp.articlePage(1, 10, 2);

// 美食 3
var foods = temp.articlePage(1, 10, 3);

// 旅游 4
var travels = temp.articlePage(1, 9, 4);

// 教育 5
var educations = temp.articlePage(1, 10,5);

// 公告
var noticeList = temp.notice(1);
%>

<% 
	var headContent = {
%>
	<% include("/template/mtg/includes/header.html"){} %>
	<meta property="qc:admins" content="3746002437626416706375" />
	<meta name="baidu-site-verification" content="HoZ9m8VIaf" />
<script type="text/javascript">
<!--
	$(function(){
		$('.carousel').carousel({
			interval: 2000
		});
		
		// js加载避免优先级问题
		$('.more').css('float','right').css('font-size','12px').css('color','green');
		
		// 最新新闻
		$("#new_news_tab").on('mousemove',function(){
			$(this).parent('li').addClass('active');
			$("#new_dynamic_tab").parent('li').removeClass('active');
			$('#new_news').show();
			$('#new_dynamic').hide();
			return false;
		});
		
		// 最新动态
		$("#new_dynamic_tab").on('mousemove',function(){
			$(this).parent('li').addClass('active');
			$("#new_news_tab").parent('li').removeClass('active');
			$('#new_dynamic').show();
			$('#new_news').hide();
			return false;
		});
		
	});
//-->
</script>

<%
};
%>

<%
var bodyContent = {
%>
<%  include("/template/mtg/includes/header_menu.html"){} %>	


<div class="container">
	
	<div class="row">
	  
	  <!-- 图片 -->
	  <div class="col-md-8">
		
		<div class="panel panel-default">
		  <div class="panel-body" style="padding: 0px;">
	
				 <div id="carousel-example-generic" class="carousel slide" data-ride="carousel">
					  <!-- Indicators -->
					  <ol class="carousel-indicators">
						  <% for(item in topPics){ %>
						  	<li data-target="#carousel-example-generic" data-slide-to="${itemLP.index-1}" ${itemLP.index==1?"class=\"active\"":""}></li>
						  <%}%>
					  </ol>

					  <!-- Wrapper for slides -->
					  <div class="carousel-inner" role="listbox">
						<% for(item in topPics){ %>
							<div style="height: 450px;" class="item ${itemLP.index==1?'active':''}">
							  <% if(strutil.isNotEmpty(item.url)) { %>
							  <a href="${item.url}" target="_blank">
							  <% } %>
							   	<img src="${flyfox.getImage(item)}" alt="${item.title}">
							  <% if(strutil.isNotEmpty(item.url)) { %>
							  </a>
							  <% } %>
							  <div class="carousel-caption">
								<h4></h4>
								<p>${item.title}</p>
							  </div>
							</div>
						<% } %>
						
						
					  </div>
	
					  <!-- Controls -->
					  <a class="left carousel-control" href="#carousel-example-generic" role="button" data-slide="prev">
						<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
						<span class="sr-only">上一页</span>
					  </a>
					  <a class="right carousel-control" href="#carousel-example-generic" role="button" data-slide="next">
						<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
						<span class="sr-only">下一页</span>
					  </a>
					</div>
		  </div>
		</div>
	  
	  </div>
	  
	  <!--  新闻 -->
	  <div class="col-md-4">
		  	<ul class="nav nav-tabs">
			  <li role="presentation" class="active" style="cursor: pointer;">
			  	<a style="cursor:pointer;" href="#" onclick="return false;" id="new_news_tab">最新新闻</a>
			  </li>
			  <li role="presentation" >
			  	<a style="cursor:pointer;" href="#"  onclick="return false;" id="new_dynamic_tab">最新动态</a>
			  </li>
			</ul>
			<div id="new_news"  class="panel panel-default" 
				style="border-top-width: 0px;border-radius:0px;border-bottom-right-radius:4px; border-bottom-left-radius: 4px;">
			   <!-- List group -->
			  <ul class="list-group">
			  	<% for(item in news.list){ %>
					<li class="list-group-item">
						<span class="badge">${flyfox.substr(item.publish_time,5,10) }</span>
						<% if(itemLP.index <= 3) { %>
						<span class="label label-success">${itemLP.index}</span>
						<% } else { %>
						<span class="label label-info">${itemLP.index}</span>
						<% } %>
						<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank" title="${item.title}">
						<% if (strutil.length(item.title) > 16) { %>
							${strutil.subStringTo(item.title, 0, 16)}...
						<% 	} else { %>
							${item.title}
						<%  } %>
						</a>
					</li>
				<% } %>
			  </ul>
			</div>
			<div id="new_dynamic" class="panel panel-default" 
				style="border-top-width: 0px;border-radius:0px;border-bottom-right-radius:4px;border-bottom-left-radius: 4px;display: none;">
			   <!-- List group -->
			  <ul class="list-group">
			  	<% for(item in newArticles.list){ %>
					<li class="list-group-item">
						<span class="badge">${flyfox.substr(item.publish_time,5,10) }</span>
						<% if(itemLP.index <= 3) { %>
						<span class="label label-success">${itemLP.index}</span>
						<% } else { %>
						<span class="label label-info">${itemLP.index}</span>
						<% } %>
						<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank" title="${item.title}">
						<% if (strutil.length(item.title) > 16) { %>
							${strutil.subStringTo(item.title, 0, 16)}...
						<% 	} else { %>
							${item.title}
						<%  } %>
						</a>
					</li>
				<% } %>
			  </ul>
			</div>
	
	  </div>
	</div>

	<div class="row">
	 	
	  <div class="col-md-8">
	  	<%  
			if(noticeList != null && noticeList.~size > 0) {
		%>
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">首页公告</h3>
		  </div>
		  <div class="panel-body">
			<%
				for(item in noticeList){ 
			%>
			<p><span class="label label-info">${itemLP.index}</span> <a href="${item.url}" target="_blank">${item.content}</a></p>
			<% 
				}
			%>
		 </div>
		</div>
		<%
			} 
		%>
	  	<!-- 旅游 -->
	  	<div class="panel panel-default">
		  <div class="panel-heading">
		  	<h3 class="panel-title">
				<a href="${BASE_PATH }${flyfox.getMenu(4)}.html" target="_blank">旅游</a>
				<a class="more" href="${BASE_PATH }${flyfox.getMenu(4)}.html" target="_blank">更多</a>
			</h3>
		  </div>
		  <div class="panel-body">
		  
		  <div class="row">
		  <% for(item in travels.list){ %>
			<div class="col-sm-6 col-md-4">
		        <div class="thumbnail">
		          <a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">
		          <img alt="${item.title}" src="${flyfox.getImage(item)}" data-holder-rendered="true" style="height: 200px; width: 100%; display: block;">
		          </a>
		          <div class="caption">
		            <a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">${item.title}</a>
		          </div>
		        </div>
		      </div>
		      <% if(itemLP.index%3==0){ %>
		  </div>
		  <div class="row">
		      <% } %>
		  <% } %>
		  </div>
	
		  </div>
		</div>
		
		<!-- 地图 -->
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">地图</h3>
		  </div>
		  <div class="panel-body" style="padding: 0px;">
		  	<div  class="thumbnail" >
		    	    <img width="100%" height="450" src="http://api.map.baidu.com/staticimage?center=116.186394,39.907031&zoom=13&width=930&height=450&markers=116.109356,39.925625"/>
		    </div>
		  </div>
		</div>
	  </div>
	
	  <div class="col-md-4">	
		
		<!-- 美食 -->
		<div class="panel panel-default">
		  <div class="panel-heading">
		  	<h3 class="panel-title">
				<a href="${BASE_PATH }${flyfox.getMenu(3)}.html" target="_blank">美食</a>
				<a class="more" href="${BASE_PATH }${flyfox.getMenu(3)}.html" target="_blank">更多</a>
			</h3>
		  </div>
		  <div class="panel-body" style="padding-bottom:0px;">
			<div class="row">
			  <% for(item in foods.list){ %>
			  	<% if(itemLP.index <= 2){ %>
			  	 <div class="col-md-6">
					<div class="thumbnail">
					  <a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">
					  <img alt="${item.title}" src="${flyfox.getImage(item)}" data-holder-rendered="true" style="height: 120px; width: 100%; display: block;">
					  </a>
					  <div class="caption">
						<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">${item.title}</a>
					  </div>
					</div>
				  </div>
			      <% } %>
			  <% } %>
			</div>
		  </div>
			
		 <ul class="list-group">
		  	<% for(item in foods.list){ %>
		  		<% if(itemLP.index > 2){ %>
				<li class="list-group-item">
					<span class="badge">${flyfox.substr(item.publish_time,5,10) }</span>
					<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank" title="${item.title}">
					<% if (strutil.length(item.title) > 18) { %>
						${strutil.subStringTo(item.title, 0, 18)}...
					<% 	} else { %>
						${item.title}
					<%  } %>
					</a>
				</li>
				<% } %>
			<% } %>
		  </ul>
			
		</div>
		
		<!-- 教育 -->
		<div class="panel panel-default">
		  <div class="panel-heading">
			<h3 class="panel-title">
				<a href="${BASE_PATH }${flyfox.getMenu(5)}.html" target="_blank">教育</a>
				<a class="more" href="${BASE_PATH }${flyfox.getMenu(5)}.html" target="_blank">更多</a>
			</h3>
		  </div>
		  
		  <div class="panel-body" style="padding-bottom:0px;">
			<div class="row">
			  <% for(item in educations.list){ %>
			  	<% if(itemLP.index <= 2){ %>
			  	 <div class="col-md-6">
					<div class="thumbnail">
					  <a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">
					  <img alt="${item.title}" src="${flyfox.getImage(item)}" data-holder-rendered="true" style="height: 120px; width: 100%; display: block;">
					  </a>
					  <div class="caption">
						<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank">${item.title}</a>
					  </div>
					</div>
				  </div>
			      <% } %>
			  <% } %>
			</div>
		  </div>
		  
		  <ul class="list-group">
		  	<% for(item in educations.list){ %>
		  		<% if(itemLP.index > 2){ %>
				<li class="list-group-item">
					<span class="badge">${flyfox.substr(item.publish_time,5,10) }</span>
					<a href="${BASE_PATH }front/article/${item.id}.html" target="_blank" title="${item.title}">
					<% if (strutil.length(item.title) > 18) { %>
						${strutil.subStringTo(item.title, 0, 18)}...
					<% 	} else { %>
						${item.title}
					<%  } %>
					</a>
				</li>
				<% } %>
			<% } %>
		  </ul>
		  
		</div>
		
		<!-- 友情链接 -->
	  	<%  include("/template/mtg/includes/friendly.html"){} %>
		</div>
	</div>

</div>
<%  include("/template/mtg/includes/footer.html"){} %>
	
<a id="scrollTop" href="javacript:void(0);" title="返回顶部" style="display: inline;"></a>
	
<%}; %>

<% layout("/pages/template/_layout.html",{head:headContent,body:bodyContent}){ %>
<%} %>
